package com.cy.ppj.dao.mapper.productannouncement;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.cy.ppj.model.domian.productannouncement.ProductAnnouncement;
import com.cy.ppj.model.enums.ProductAndAnnouncementType;
import com.cy.ppj.model.query.productannouncement.ProductAnnouncementAdminQuery;
import com.cy.ppj.model.query.productannouncement.ProductAnnouncementQuery;
import com.cy.ppj.model.vo.admin.productannouncement.ProductAnnouncementAdminVO;
import com.cy.ppj.model.vo.front.message.MessageIndexVO;
import com.cy.ppj.model.vo.front.productannouncement.ProductAnnouncementVO;

import tk.mybatis.mapper.common.BaseMapper;

/**
 * 产品公告
 *
 * @author: tanyilin
 * @create: 2018年10月15日 下午5:06:50
 */
@Mapper
public interface ProductAnnouncementMapper extends BaseMapper<ProductAnnouncement>{

	int selectProductAnnouncementAdminCount(ProductAnnouncementAdminQuery query);

	List<ProductAnnouncementAdminVO> selectProductAnnouncementAdminList(ProductAnnouncementAdminQuery query);

	int selectProductAnnouncementCount(ProductAnnouncementQuery query);

	List<ProductAnnouncementVO> selectProductAnnouncementList(ProductAnnouncementQuery query);

	MessageIndexVO selectMessageIndexInfo(@Param("type") ProductAndAnnouncementType type);
	
	int selectUnReadCountByTimeAndType(@Param("type") ProductAndAnnouncementType type, @Param("lastReadTime") Date lastReadTime,
			@Param("nowTime") Date nowTime);
}
